import { GaRegExp, ruleInject, ruleInjectable } from "../InjectionRule";
import { blankRemove } from "../methods/blank-remove";

@ruleInjectable()
export default class typeCalcRule extends GaRegExp {

	@ruleInject() private typeDataRule!: GaRegExp;

	public RuleInit() {
		this.ParseRule([
			this.Supply("TYPE_CALC"),
			"(-", this.typeDataRule, "|", "\\(", blankRemove, "(", this, ")", "\\)", ")",
			blankRemove,

			"(",
			"(![&\\|])",
			blankRemove,
			"(-", this.typeDataRule, "|", "\\(", blankRemove, "(", this, ")", "\\)", ")",
			blankRemove,
			")*",
		]);
	}

}
